﻿using ExcellentProject.Behaviors;
using ExcellentProject.Behaviors.Html;
using ExcellentProject.Dominio.Cuestionarios.Entidades;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ExcellentProject.Examenes.Controles
{
    public partial class ControlPreguntas : System.Web.UI.UserControl
    {
        #region Propiedades
        IRenderBehavior<Pregunta> renderBehavior;

        public Pregunta Pregunta
        {
            get;
            set;
        }
        #endregion


        protected void Page_Load(object sender, EventArgs e)
        {
            if (Pregunta == null)
                throw new ArgumentNullException("Pregunta no definida");

            switch (Pregunta.CodigoTipo)
            {
                    //Seleccion simple
                case "REA":
                    //Para readin
                    break;
                case "LIS":
                    //Pregunta multimedia
                    renderBehavior = new ResourceQuestionRenderBehavior();
                    break;
                    //
                default:
                    renderBehavior = new CommonQuestionRenderBehavior();
                    break;
            }

            renderBehavior.RenderQuestion(questionPanel, Pregunta);
        }
    }
}